package tp.pr3.items;

public abstract class ExpirationItem extends Item
{

	protected int times;

	public ExpirationItem(String id, String description, int times)
	{
		super(id, description);
		this.times = times;
		this.toStringString += "//";
	}

	protected int getTimes()
	{
		return times;
	}

	public String toString()
	{
		return this.toStringString + this.times;
	}

	public void decrement()
	{
		this.times--;
		if (this.times<1) {
			System.out.println("The "+this.id+ " is empty. It is deleted from the inventory.");
			this.id="";//antes this.id=null;
		
		}
	}

	public boolean canBeUsed()
	{
		boolean puede=true;
		if (this.times < 1)
		{
			puede=false;
		}
		
		return puede;

	}
}
